package com.waste.game.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.waste.game.entity.entitiytv.VideoAllBean;
import com.waste.game.entity.entitiytv.VideoPageBean;
import com.waste.game.entity.entitiytv.VideoPlBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(rollbackFor = RuntimeException.class)
public interface VideoAllDao extends BaseMapper<VideoAllBean> {
    //猜你喜欢番剧查询---------待修改演示用
//    @Select("SELECT v_name,v_epic,v_data,v_img,v_index FROM videoall LIMIT #{num}")
    List<VideoAllBean> getVideoDoLike(@Param("num") int num);
    //查询番剧信息
//    @Select("SELECT v_data,v_name,v_msg,v_index,v_img_l FROM videoall WHERE v_id = #{num}")
    List<VideoAllBean> getVideoMsg(int num);
    //查询集数视频url
//    @Select("SELECT v_epic_name,v_url,v_type FROM videourl WHERE v_id = #{num}")
    //视频搜索
//    @Select("SELECT v_id,v_name,v_msg,v_index,v_epic,v_img_l,v_person,v_type_a,v_up_time FROM videoall WHERE v_name like concat('%',#{content},'%') LIMIT #{num},#{num2}")
    List<VideoAllBean> getSearch(@Param("content") String content);

    //首页查询猜你喜欢
//    @Select("SELECT v_id,v_name,v_title_tip,v_index,v_img_l,v_s_type FROM videoall LIMIT 28")
    List<VideoAllBean> getDoLike();
    //后台视频列表查询
    List<VideoAllBean> getVideoList();
    //后台查询单个视频信息
    VideoAllBean getVideoOne(@Param("id") Integer id);
    //修改单个视频信息
    int upDateOne(@Param("a") VideoAllBean videoAllBean);
    //插入视频记录
    int insertOne(@Param("a") VideoAllBean videoAllBean);
    //未筛选
//    @Select("SELECT id,v_type,v_data,v_name,v_title_tip,v_img_l,v_index,v_epic FROM videoall ORDER BY v_up_time DESC")
//    List<VideoAllBean> getSearchAllOne();
    //类型筛选
//    @Select("SELECT id,v_data,v_name,v_title_tip,v_img_l,v_index,v_epic FROM videoall WHERE v_type = #{num} OR v_type2 = #{num} LIMIT #{cxnums},#{cxnume}")
//    List<VideoAllBean> getSearchLX(int num,int cxnums,int cxnume);
    //筛选时间和类型
//    @Select("SELECT id,v_data,v_name,v_title_tip,v_img_l,v_index,v_epic FROM videoall WHERE v_time = #{year} LIMIT #{cxnums},#{cxnume}")
//    List<VideoAllBean> getSearchYear(String year,int cxnums,int cxnume);
    //筛选状态，地区，时间，类型
    List<VideoAllBean> getSearchAll(@Param("ss") VideoAllBean videoAllBean);
}
